package o;

import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;

public class xz implements yc<Bitmap, byte[]> {
    private final int ˊ;
    private final CompressFormat ˏ;

    public xz() {
        this(CompressFormat.JPEG, 100);
    }

    public xz(@NonNull CompressFormat compressFormat, int i) {
        this.ˏ = compressFormat;
        this.ˊ = i;
    }

    @Nullable
    public tx<byte[]> ˋ(@NonNull tx<Bitmap> txVar, @NonNull sc scVar) {
        OutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        ((Bitmap) txVar.ˋ()).compress(this.ˏ, this.ˊ, byteArrayOutputStream);
        txVar.ॱॱ();
        return new xk(byteArrayOutputStream.toByteArray());
    }
}
